package j2024.j202410;

import java.util.PriorityQueue;
import java.util.Scanner;

public class j1014 {
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(),k = in.nextInt();
        int[] arr = new int[n];
        PriorityQueue<Integer> queue = new PriorityQueue<>((a,b)->{
            return a-b;
        });
        for (int i = 0; i < n; i++) {
            arr[i] = in.nextInt();
            queue.offer(arr[i]);
        }
        int cou = 0;
        int ret = 0;
        while(cou<=k){
            int tmp = queue.poll();
            cou+=tmp;
            if(cou>k){
                break;
            }
            queue.offer(tmp*2);
            ret++;
        }
        System.out.println(ret);
    }

    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        for (int i = 0; i < T; i++) {
            long n = in.nextInt(),a = in.nextInt(),b = in.nextInt();
            long ret1 = cou(n,a,2);
            long ret2 = cou(n,b,3);
            System.out.println(Math.min(ret1,ret2));
        }
    }
    public static long cou(long n,long x,int c){
        long a = n%c==0 ? n/c:n/c+1;
        return a*x;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long a = in.nextLong();
        int[] arr = new int[18];
        int index = 0;
        long sum = 0;
        while(a>0){
            arr[index++] = (int)(a%10);
            sum+=(int)(a%10);
            a/=10;
        }
        int left = 0,right = 0;
        int num = 0;
        while(right<arr.length){
            while(right<arr.length && num<sum){
                num+=arr[right];
                sum-=arr[right];
                right++;
            }
            if(num==sum){
                break;
            }
            if(num>sum){
                num-=arr[left];
                sum+=arr[left];
            }
        }
        if(num == sum){
            System.out.println("Yes");
        }else {
            System.out.println("No");
        }

    }
}
